package response

type Resp struct {
	Code    int         `json:"code"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

func (r Resp) Success(data *any) Resp {
	r.Code = 0
	r.Message = "success"
	r.Data = data
	return r
}

func (r Resp) Warning(code int, message string) Resp {
	r.Code = code
	r.Message = message
	return r
}
